package com.novel.entiy.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * @author chihuo
 * @date 2022/4/8
 */
@ApiModel(value = "评论")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CommentVO {
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "")
    private Long id;

    /**
     * 评论内容
     */
    @ApiModelProperty(value = "评论内容")
    private String commentContent;

    /**
     * 小说id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "小说id")
    private Long novelId;

    /**
     * 评论用户id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "评论用户id")
    private Long commentUserId;

    /**
     * 评论用户名称
     */
    @ApiModelProperty(value = "评论用户名称")
    private String commentUserName;

    /**
     * 父评论id（0为父评论,其他为回复评论）
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "父评论id（0为父评论,其他为回复评论）")
    private Long commentParentId;

    /**
     * 回复的评论id(可能回复评论 也可能回复评论的回复）
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "回复的评论id(可能回复评论 也可能回复评论的回复）")
    private Long commentReplyId;

    /**
     * 回复的评论用户名称
     */
    @ApiModelProperty(value = "回复的评论用户名称")
    private String commentReplyUserName;

    /**
     * 回复的评论用户id
     */
    @ApiModelProperty(value = "回复的评论用户id")
    private Long commentReplyUserId;

    /**
     * 0:评论 1:回复
     */
    @ApiModelProperty(value = "0:评论 1:回复")
    private Integer commentType;

    /**
     * 时间差
     */
    @ApiModelProperty(value = "时间差")
    private Long diff;

    /**
     * 时间差单位
     */
    @ApiModelProperty(value = "时间差单位")
    private String diffUnit;

    /**
     * 更新时间
     */
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    private Date updatedTime;

    /**
     * 点赞数
     */
    @ApiModelProperty(value = "点赞数")
    private Long commentNums;

    @ApiModelProperty("评论回复List")
    private List<CommentVO> commentReplyList;

    @ApiModelProperty("当前用户是否点过赞")
    private Boolean alreadySupport;

    public static final String COL_ID = "id";

    public static final String COL_COMMENT_CONTENT = "comment_content";

    public static final String COL_NOVEL_ID = "novel_id";

    public static final String COL_COMMENT_USER_ID = "comment_user_id";

    public static final String COL_COMMENT_USER_NAME = "comment_user_name";

    public static final String COL_COMMENT_PARENT_ID = "comment_parent_id";

    public static final String COL_COMMENT_REPLY_ID = "comment_reply_id";

    public static final String COL_COMMENT_TYPE = "comment_type";

    public static final String COL_CREATED_TIME = "created_time";

    public static final String COL_UPDATED_TIME = "updated_time";
}